<table class="ui-table-order">
	<thead class="js-list-header-region tableFloatingHeaderOriginal" style="position: static; top: 0px; margin-top: 0px; left: 150px; z-index: 1; width: 849px;">
		<tr class="widget-list-header">
			<th class="" colspan="2" style="width: 377px">商品</th>
			<th class="price-cell" style="width: 80px">单价/数量</th>
			<th class="aftermarket-cell" style="width: 100px">售后</th>
			<th class="customer-cell" style="width: 120px">买家</th>
			<th class="time-cell" style="width: 90px">下单时间</th>
			<th class="status-cell" style="width: 110px">订单状态</th>
			<th class="pay-price-cell" style="width: 110px">总金额</th>
		</tr>
	</thead>
	<if condition="empty($list)">
	<tr class="content-row">
		<td class="text-center" colspan="8">没有相关订单</td>
	</tr>
	<else/>
	<foreach name="list" item="trade" key="tid">
	<tbody class="widget-list-item" data-tid="{$tid}">
		<tr class="separation-row">
			<td colspan="8"></td>
		</tr>
		<tr class="header-row">
			<td colspan="5">
                <?php if ($trade['edit_out_tid']) { 
                	echo '<a class="order-no js-order-no" href="javascript:;">订单号: '.$tid.'</a>';
                }else{
                    echo '订单号:'.$tid;
                }?>
                <div class="order-no-1688">
                <?php if (!empty($trade['alibaba'])) { 
                    echo '<span class="label label-warning">1688</span>';
                    foreach($trade['alibaba'] as $alibaba){
                        if(!empty($alibaba['out_tid'])){
                            echo '<a href="https://trade.1688.com/order/unify_buyer_detail.htm?orderId='.$alibaba['out_tid'].'" target="_blank" title="'.$alibaba['buyer_login_id'].'">'.$alibaba['out_tid'].'</a>';
                        }
                    }
                }?>
                </div>
                <notempty name="trade['express']">
                <span class="seller-send-all">运单号:
                    <foreach name="trade['express']" key="index" item="item">
                        {$index>0?'&nbsp;&nbsp;':''}<a href="http://m.kuaidi100.com/result.jsp?nu={$item[1]}" target="_blank" title="{$item[0]}">{$item[1]}</a>
                    </foreach>
                </span>
                </notempty> 
				<!-- 
				<div class="help">
					<span class="js-help-notes c-gray" data-class="bottom" style="cursor: help;">到店付款</span>
				</div>
				<span class="c-gray">/ 到店自提</span>
				 -->
			</td>
			<td colspan="3" class="text-right">
				<div class="order-opts-container">
					<div class="js-memo-star-container memo-star-container">
						<div class="opts">
							<div class="td-cont message-opts">
								<div class="m-opts">
                                    <notempty name="trade['alibaba']">
                                    <a href="__MODULE__/alibaba/syncTrade?tid={$tid}" target="_blank">同步1688订单</a>
                                    <span>-</span>
                                    </notempty>
									<if condition="($trade['status'] eq 'toout' or $trade['status'] eq 'send')">
										<a href="javascript:;" class="js-set-send">运单维护</a>
										<span>-</span>
									</if>
									<if condition="$trade['can_cancel'] eq 1">
										<a href="javascript:;" class="js-cancel-order">取消订单</a>
										<span>-</span>
									</if>
									<a class="js-set-seller-remark" rel="popover" href="javascript:;">备注</a>
									<span>-</span>
									<a href="__MODULE__/order/detail?tid={$tid}" class="js-order-detail">查看详情</a>
								</div>
							</div>
						</div>
					</div>
				</div>
			</td>
		</tr>
        <?php $firstOrder=key($trade['orders']);?>
		<foreach name="trade['orders']" key="index" item="order">
		<?php if($index==$firstOrder){ $rowspan = count($trade['orders']);?>
		<tr class="content-row">
			<td class="image-cell">
				<img src="{$order.pic_url}">
			</td>
			<td class="title-cell">
				<p class="goods-title ellipsis">
					<a href="/h5/goods?id={$order.goods_id}" target="_blank" class="new-window">{$order.title}</a>
				</p>
				<p>{$order.spec} <a class="js-goods_feedback" data-gid="{$order.goods_id}" title="反馈"><i class="icon-pencil"></i></a></p>
                <p style="color: #ED5050;">{$order['errmsg']}</p>
			</td>
			<td class="price-cell">
				<p>{$order.price}</p>
				<p>({$order.num}件)</p>
			</td>
			<td class="aftermarket-cell" rowspan="{$rowspan}">
				<a href="javascript:;" data-tid="{$trade['tid']}" class="js-btn-cancel">{$trade.refunded_desc}</a>
			</td>
			<td class="customer-cell" rowspan="{$rowspan}">
				<p><a href="/member?mid={$trade.buyer_id}" target="_blank">{$trade.buyer_nick}</a></p>
				<p class="user-name">{$trade.receiver_name}</p>{$trade.receiver_mobile}
			</td>
			<td class="time-cell" rowspan="{$rowspan}">
				<div class="td-cont">{$trade.created}</div>
			</td>
			<td class="status-cell" rowspan="{$rowspan}" style="padding-left:0;padding-right:0">
				<div class="td-cont">
					<p class="js-order-status">{$trade.status_str}</p>
				</div>
			</td>
			<td class="pay-price-cell" rowspan="{$rowspan}">
				<p>{$trade['sum_fee']}元</p>
                <p>(含运费{$trade['post_fee']}元)</p>
			</td>
		</tr>
		<?php }else{ ?>
		<tr class="content-row">
			<td class="image-cell">
				<img src="{$order.pic_url}">
			</td>
			<td class="title-cell">
				<p class="goods-title">
					<a href="/h5/goods?id={$order.goods_id}" target="_blank"get="_blank" class="new-window">{$order.title}</a>
				</p>
				<p>{$order.spec} <a class="js-goods_feedback" data-gid="{$order.goods_id}" title="反馈"><i class="icon-pencil"></i></a></p>
                <p style="color: #ED5050;">{$order['errmsg']}</p>
			</td>
			<td class="price-cell">
				<p>{$order.price}</p>
				<p>({$order.num}件)</p>
			</td>
		</tr>
		<?php } ?>
		</foreach>
		<notempty name="trade['buyer_remark']">
		<tr class="remark-row buyer-msg">
			<td colspan="8">买家备注： {$trade.buyer_remark}</td>
		</tr>
		</notempty>
		<notempty name="trade['seller_remark']">
		<tr class="remark-row seller-msg">
			<td colspan="8">卖家备注： {$trade.seller_remark}</td>
		</tr>
		</notempty>
	</tbody>
	</foreach>
	</if>
</table>
<div id="pagination" style="text-align: right;" data-page="{$page}" data-total="{$total}" data-offset="{$offset}"></div>